package com.sie.util;

import com.sie.entity.Authority;
import com.sie.entity.ViewEmp;

import javax.servlet.http.HttpServletRequest;

public class AsdUtils {
    public static boolean asd(HttpServletRequest request, String name) {
        ViewEmp user = (ViewEmp) request.getAttribute("user");
        for (Authority authority : user.getAuthorities()) {
            if (name.equals(authority.getAuthName())) {
                return  true;
            }
        }
        return false;
    }
}
